home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / g_man / cat3 / OpenGL / hyperpipe.z / hyperpipe
Encoding:
Text File  |  2001-04-17  |  11.3 KB  |  331 lines

  1.  
  2.  
  3.  
  4. GGGGLLLLXXXX____SSSSGGGGIIIIXXXX____hhhhyyyyppppeeeerrrrppppiiiippppeeee          OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee ---- GGGGLLLLXXXX          GGGGLLLLXXXX____SSSSGGGGIIIIXXXX____hhhhyyyyppppeeeerrrrppppiiiippppeeee
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      GLX_SGIX_hyperpipe - hyperpipe extension
  10.  
  11. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  12.      Even though graphics hardware is constantly improving in speed, there
  13.      will always be applications that require more performance than is
  14.      available from a single pipeline. In order to overcome these limits, it
  15.      is possible to parallelize the rendering task across multiple pipes; the
  16.      image outputs of these pipes must then be assembled into a single display
  17.      output. This group of pipes is termed a hyperpipe; the pipes involved
  18.      must be physically cabled together in some way to form a hyperpipe
  19.      network. Typically a hyperpipe network uses one of the pipes to assemble
  20.      the rendered images and drive the display.
  21.  
  22.      In a hyperpipe network, the rendering task may be divided by rendering
  23.      each successive frame on a different hardware pipe (temporal division);
  24.      by dividing the frame into rectangular subregions and rendering each on a
  25.      different pipe (spatial division); or by a combination of these two
  26.      techniques. Specific hardware implementations may impose limits on how
  27.      rendering may be subdivided; but in general it is possible to use a
  28.      subset of the pipes connected to a hyperpipe network if desired.
  29.  
  30.      This extension provides a means for configuring and managing a group of
  31.      rendering pipes which work together to produce a single display.
  32.      Typically, a hyperpipe application will be multi threaded, with one
  33.      thread per pipe; each thread needs to create its own rendering context.
  34.      The hyperpipe extension allows these rendering threads to communicate
  35.      with the hardware.
  36.  
  37.      The API calls allow an application to:
  38.  
  39.      o  Determine the physical configuration of a hyperpipe network.
  40.  
  41.      o  Configure the hyperpipe. The hyperpipe configuration used by the
  42.         application may be a subset of the physical hyperpipe network.
  43.         The rendering task may be divided in time slices (temporally divided),
  44.         in rectangular regions of a single frame (spatially divided), or both.
  45.         The hyperpipe configuration is subject to hardware constraints.
  46.  
  47.         For example, on a hyperpipe network consisting of five pipes, it
  48.         would be possible to configure a rendering task in two time slices,
  49.         with each slice being rendered by two pipes; thus using four total
  50.         pipes. (The fifth pipe would not be used in the hyperpipe, and
  51.         could be used for normal non-hyperpipe rendering and display).
  52.  
  53.      o  Maintain state to manage the glXSwapBuffers  call correctly. In
  54.         spatial subdivision, swap cannot occur until all pipes rendering
  55.         the next frame have completed; and in temporal subdivision, swap
  56.         cannot occur until the appropriate time. Swap management is
  57.         handled by the displaying pipe.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. GGGGLLLLXXXX____SSSSGGGGIIIIXXXX____hhhhyyyyppppeeeerrrrppppiiiippppeeee          OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee ---- GGGGLLLLXXXX          GGGGLLLLXXXX____SSSSGGGGIIIIXXXX____hhhhyyyyppppeeeerrrrppppiiiippppeeee
  71.  
  72.  
  73.  
  74.      o  Redirect resize parameters correctly; typically resize is handled
  75.         by the displaying pipe, and must be managed synchronously with
  76.         swap.
  77.  
  78.      o  Balance load among the pipes in the spatial subdivision case.
  79.  
  80.      o  Clean up operations when a hyperpipe application terminates
  81.         (either normally or due to error).
  82.  
  83.      This extension adds to the set of conditions that must be met before a
  84.      buffer swap can take place.
  85.  
  86. FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNNSSSS
  87.      The main functions are:
  88.  
  89.      ggggllllXXXXQQQQuuuueeeerrrryyyyHHHHyyyyppppeeeerrrrppppiiiippppeeeeNNNNeeeettttwwwwoooorrrrkkkkSSSSGGGGIIIIXXXX - query the physical hyperpipe network.
  90.  
  91.      ggggllllXXXXHHHHyyyyppppeeeerrrrppppiiiippppeeeeCCCCoooonnnnffffiiiiggggSSSSGGGGIIIIXXXX - configure the hyperpipe network.
  92.  
  93.      ggggllllXXXXQQQQuuuueeeerrrryyyyHHHHyyyyppppeeeerrrrppppiiiippppeeeeCCCCoooonnnnffffiiiiggggSSSSGGGGIIIIXXXX - query a particular hyperpipe configuration.
  94.  
  95.      ggggllllXXXXDDDDeeeessssttttrrrrooooyyyyHHHHyyyyppppeeeerrrrppppiiiippppeeeeCCCCoooonnnnffffiiiiggggSSSSGGGGIIIIXXXX - destroy a hyperpipe configuration.
  96.  
  97.      ggggllllXXXXBBBBiiiinnnnddddHHHHyyyyppppeeeerrrrppppiiiippppeeeeSSSSGGGGIIIIXXXX - bind a process and rendering context to a
  98.      hyperpipe configuration.
  99.  
  100. NNNNOOOOTTTTEEEESSSS
  101.      In addition to its usual functionality, the ggggllllXXXXSSSSwwwwaaaappppBBBBuuuuffffffffeeeerrrrssss call on a
  102.      rendering context bound to a hyperpipe causes the hyperpipe display
  103.      output to switch to the next pipe of the network.
  104.  
  105.      Hyperpipes cannot function on single buffered visuals; double buffered
  106.      visuals are required on all bound graphics contexts.
  107.  
  108.      The hyperpipe id associated with a context can be determined by calling
  109.      ggggllllXXXXQQQQuuuueeeerrrryyyyCCCCoooonnnntttteeeexxxxttttIIIInnnnffffooooEEEEXXXXTTTT with an attribute of GGGGLLLLXXXX____HHHHYYYYPPPPEEEERRRRPPPPIIIIPPPPEEEE____IIIIDDDD____SSSSGGGGIIIIXXXX....
  110.  
  111. SSSSAAAAMMMMPPPPLLLLEEEE CCCCOOOODDDDEEEE
  112.      Typically, a hyperpipe application will have a master process which:
  113.  
  114.      o Queries the hyperpipe network;
  115.  
  116.      o Chooses which of the pipes on the hyperpipe network to use;
  117.  
  118.      o Sets up a hyperpipe configuration using the above pipes;
  119.  
  120.      o Forks off one (or more) rendering processes per pipe.
  121.  
  122.      Each of the created child processes will:
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. GGGGLLLLXXXX____SSSSGGGGIIIIXXXX____hhhhyyyyppppeeeerrrrppppiiiippppeeee          OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee ---- GGGGLLLLXXXX          GGGGLLLLXXXX____SSSSGGGGIIIIXXXX____hhhhyyyyppppeeeerrrrppppiiiippppeeee
  137.  
  138.  
  139.  
  140.      o Create its own window and a direct rendering graphics context;
  141.  
  142.      o Binds the rendering context to the hyperpipe id supplied by
  143.        the master process.
  144.  
  145.      Master Process
  146.  
  147.           GLXHyperpipeNetworkSGIX * nw;
  148.           GLXHyperpipeConfigSGIX cfg[32];
  149.           char * extString;
  150.  
  151.           /* Open the default display */
  152.           dpy = XOpenDisplay( 0 );
  153.  
  154.           scr = DefaultScreen( dpy );
  155.  
  156.           /* Query the extension string to verify that the
  157.           ** hyperpipe extension is present
  158.           */
  159.  
  160.           extString = (char *)glXQueryExtensionsString(dpy,scr);
  161.  
  162.           if (!strstr( extString, "GLX_SGIX_hyperpipe")) {
  163.                /* Abort */
  164.           }
  165.  
  166.           /* Query the hyperpipe network */
  167.  
  168.           nw  = glXQueryHyperpipeNetworkSGIX(dpy, &npipes);
  169.           if ( (nw== NULL) || (npipes == 0 ) ) {
  170.                /* No hyperpipe network, Abort */
  171.           }
  172.  
  173.           /* Choose some pipes from the above list in nw and fill in the
  174.           ** configuration structure
  175.           ** The sample code below sets up a 3 pipe hyperpipe
  176.           */
  177.  
  178.           nid = nw[0].networkId;
  179.           npipes = 2;
  180.  
  181.           for (i=0; i<npipes; i++) {
  182.  
  183.                strcpy (cfg[i].pipeName, nw[i].pipeName);
  184.                cfg[i].participationType = GLX_HYPERPIPE_RENDER_PIPE_SGIX;
  185.                cfg[i].timeSlice = i;
  186.                cfg[i].channel = 0;
  187.           }
  188.  
  189.           /* Choose the first pipe to be the display pipe also */
  190.  
  191.           cfg[0].participationType |=  GLX_HYPERPIPE_DISPLAY_PIPE_SGIX;
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. GGGGLLLLXXXX____SSSSGGGGIIIIXXXX____hhhhyyyyppppeeeerrrrppppiiiippppeeee          OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee ---- GGGGLLLLXXXX          GGGGLLLLXXXX____SSSSGGGGIIIIXXXX____hhhhyyyyppppeeeerrrrppppiiiippppeeee
  203.  
  204.  
  205.  
  206.           if (glXHyperpipeConfigSGIX( dpy,
  207.                nw[0].networkId,
  208.                npipes,
  209.                cfg,
  210.                &hpId)
  211.                == GLX_BAD_HYPERPIPE_CONFIG_SGIX) {
  212.  
  213.                /*Something wrong with the hyperpipe configuration;Abort */
  214.           }
  215.  
  216.           /* Don't need the hyperpipe network information any more */
  217.  
  218.           XFree (nw);
  219.  
  220.           /*Now fork npipes number of process */
  221.  
  222.           /* hang around untill all child processes finish */
  223.           glXDestroyHyperpipeConfigSGIX(dpy, hpId);
  224.  
  225.  
  226.      Each child process then calls :
  227.  
  228.           /* Open Display and screen */
  229.  
  230.           /* sanity checking to ensure that the hyperpipe
  231.           ** is present on the required pipes
  232.           */
  233.  
  234.           extString = (char *)glXQueryExtensionsString(dpy,scr);
  235.           if (!strstr( extString, "GLX_SGIX_hyperpipe")) {
  236.  
  237.                /* Abort */
  238.           }
  239.  
  240.           /* Create a direct rendering context and make it current */
  241.  
  242.           if (glXBindHyperpipeSGIX (dpy, hpId) {
  243.  
  244.                /* Error in bind; Abort */
  245.           }
  246.  
  247.           /* Render */
  248.  
  249.           glXSwapBuffers(...);
  250.  
  251.           /* All done */
  252.  
  253.           glXBindHyperpipeSGIX(dpy, -1);
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. GGGGLLLLXXXX____SSSSGGGGIIIIXXXX____hhhhyyyyppppeeeerrrrppppiiiippppeeee          OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee ---- GGGGLLLLXXXX          GGGGLLLLXXXX____SSSSGGGGIIIIXXXX____hhhhyyyyppppeeeerrrrppppiiiippppeeee
  269.  
  270.  
  271.  
  272. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  273.      glXQueryHyperpipeNetworkSGIX(), glXHyperpipeConfigSGIX(),
  274.      glXQueryHyperpipeConfigSGIX(), glXDestroyHyperpipeConfigSGIX(),
  275.      glXBindHyperpipeSGIX()
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.                                                                         PPPPaaaaggggeeee 5555
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.